🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / androidApp / src / google / kotlin / org / meshtastic / app / ai / appfunctions / MeshtasticAppFunctions.kt
Displaying Raw • Download
androidApp/src/google/kotlin/org/meshtastic/app/ai/appfunctions/MeshtasticAppFunctions.kt 2d20cd8a4708e2ef66e98d5259f3a97ec93f240a (2d20cd8a) Text, 18.52 KB
T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.app.ai.appfunctions
Tff7b72import T7ee787androidx.appfunctions.AppFunction
Tff7b72import T7ee787androidx.appfunctions.AppFunctionContext
Tff7b72import T7ee787androidx.appfunctions.AppFunctionElementNotFoundException
Tff7b72import T7ee787androidx.appfunctions.AppFunctionIntValueConstraint
Tff7b72import T7ee787androidx.appfunctions.AppFunctionInvalidArgumentException
Tff7b72import T7ee787androidx.appfunctions.AppFunctionNotSupportedException
Tff7b72import T7ee787kotlinx.coroutines.TimeoutCancellationException
Tff7b72import T7ee787org.meshtastic.core.data.ai.AiFunctionProvider
Tff7b72import T7ee787org.meshtastic.core.data.ai.SendMessageResult
T8b949e/**
* Exposes Meshtastic mesh networking capabilities to system AI assistants via the Android App Functions API. Functions
* declared here are discoverable by the system and can be invoked by AI agents such as Gemini.
*/
Tff7b72class T56d364MeshtasticAppFunctionsTb4b4b4(Tff7b72private Tff7b72val Te6edf3providerTb4b4b4: Te6edf3AiFunctionProviderTb4b4b4) Tb4b4b4{
T8b949e/**
* Send a text message over the Meshtastic mesh radio network.
*
* Messages are transmitted to nearby mesh nodes using LoRa radio. The mesh network is ideal for off-grid
* communications where cellular service is unavailable.
*
* @param context The app function invocation context provided by the system.
* @param text The message text to send (max 237 bytes).
* @param recipientName Optional name of a specific node to send a direct message to. If omitted, the message is
* broadcast to all nodes on the specified channel.
* @param channelName Optional channel name to broadcast on. If omitted, uses the primary channel. Ignored when
* recipientName is specified.
* @return A [SendMessageResponse] with the message ID, channel, and timestamp.
*/
Tf0883e@AppFunctionTb4b4b4(Te6edf3isDescribedByKDoc Tff7b72= Tff7b72trueTb4b4b4)
Tff7b72suspend Tff7b72fun Td2a8ffsendMessageTb4b4b4(
Te6edf3contextTb4b4b4: Te6edf3AppFunctionContextTb4b4b4,
Te6edf3textTb4b4b4: Tffa657StringTb4b4b4,
Te6edf3recipientNameTb4b4b4: Tffa657String? Tff7b72= Tff7b72nullTb4b4b4,
Te6edf3channelNameTb4b4b4: Tffa657String? Tff7b72= Tff7b72nullTb4b4b4,
Tb4b4b4)Tb4b4b4: Te6edf3SendMessageResponse Tb4b4b4{
Tff7b72val Te6edf3result Tff7b72=
Tff7b72try Tb4b4b4{
Te6edf3providerTb4b4b4.Te6edf3sendMessageTb4b4b4(Te6edf3textTb4b4b4, Te6edf3recipientNameTb4b4b4, Te6edf3channelNameTb4b4b4)
Tb4b4b4} Tff7b72catch Tb4b4b4(Te6edf3_Tb4b4b4: Te6edf3TimeoutCancellationExceptionTb4b4b4) Tb4b4b4{
Tff7b72throw Te6edf3AppFunctionInvalidArgumentExceptionTb4b4b4(
Ta5d6ff"Ta5d6ffRequest timed out. Ensure the mesh is connected and try again.Ta5d6ff"Tb4b4b4,
Tb4b4b4)
Tb4b4b4}
Tff7b72return Tff7b72when Tb4b4b4(Te6edf3resultTb4b4b4) Tb4b4b4{
Tff7b72is Te6edf3SendMessageResultTb4b4b4.Te6edf3Success Tff7b72-Tff7b72>
Te6edf3SendMessageResponseTb4b4b4(
Te6edf3messageId Tff7b72= Te6edf3resultTb4b4b4.Te6edf3messageIdTb4b4b4,
Te6edf3channel Tff7b72= Te6edf3resultTb4b4b4.Te6edf3channelTb4b4b4,
Te6edf3timestamp Tff7b72= Te6edf3resultTb4b4b4.Te6edf3timestampTb4b4b4,
Tb4b4b4)
Tff7b72is Te6edf3SendMessageResultTb4b4b4.Te6edf3NotConnected Tff7b72-Tff7b72> Tff7b72throw Te6edf3AppFunctionNotSupportedExceptionTb4b4b4(Te6edf3resultTb4b4b4.Te6edf3messageTb4b4b4)
Tff7b72is Te6edf3SendMessageResultTb4b4b4.Te6edf3AmbiguousName Tff7b72-Tff7b72> Tb4b4b4{
Tff7b72val Te6edf3names Tff7b72= Te6edf3resultTb4b4b4.Te6edf3candidatesTb4b4b4.Te6edf3joinToStringTb4b4b4(Tb4b4b4)
Tff7b72throw Te6edf3AppFunctionInvalidArgumentExceptionTb4b4b4(
Ta5d6ff"Ta5d6ffMultiple nodes match that name: Tffd700$Te6edf3namesTa5d6ff. Please be more specific.Ta5d6ff"Tb4b4b4,
Tb4b4b4)
Tb4b4b4}
Tff7b72is Te6edf3SendMessageResultTb4b4b4.Te6edf3InvalidArgument Tff7b72-Tff7b72> Tff7b72throw Te6edf3AppFunctionInvalidArgumentExceptionTb4b4b4(Te6edf3resultTb4b4b4.Te6edf3reasonTb4b4b4)
Tff7b72is Te6edf3SendMessageResultTb4b4b4.Te6edf3RateLimited Tff7b72-Tff7b72>
Tff7b72throw Te6edf3AppFunctionInvalidArgumentExceptionTb4b4b4(
Ta5d6ff"Ta5d6ffRate limit exceeded. Try again in Tffd700${Te6edf3resultTb4b4b4.Te6edf3retryAfterSecondsTffd700}Ta5d6ff seconds.Ta5d6ff"Tb4b4b4,
Tb4b4b4)
Tb4b4b4}
Tb4b4b4}
T8b949e/**
* Get the current status of the Meshtastic mesh network.
*
* Returns connection state, number of online nodes, total known nodes, the connected device's battery level, and
* the local node name.
*
* @param context The app function invocation context provided by the system.
* @return A [MeshStatusResponse] with the current mesh network status.
*/
Tf0883e@AppFunctionTb4b4b4(Te6edf3isDescribedByKDoc Tff7b72= Tff7b72trueTb4b4b4)
Tff7b72suspend Tff7b72fun Td2a8ffgetMeshStatusTb4b4b4(Te6edf3contextTb4b4b4: Te6edf3AppFunctionContextTb4b4b4)Tb4b4b4: Te6edf3MeshStatusResponse Tb4b4b4{
Tff7b72val Te6edf3status Tff7b72=
Tff7b72try Tb4b4b4{
Te6edf3providerTb4b4b4.Te6edf3getMeshStatusTb4b4b4(Tb4b4b4)
Tb4b4b4} Tff7b72catch Tb4b4b4(Te6edf3_Tb4b4b4: Te6edf3TimeoutCancellationExceptionTb4b4b4) Tb4b4b4{
Tff7b72throw Te6edf3AppFunctionInvalidArgumentExceptionTb4b4b4(
Ta5d6ff"Ta5d6ffRequest timed out. Ensure the mesh is connected and try again.Ta5d6ff"Tb4b4b4,
Tb4b4b4)
Tb4b4b4}
Tff7b72return Te6edf3MeshStatusResponseTb4b4b4(
Te6edf3connectionState Tff7b72= Te6edf3statusTb4b4b4.Te6edf3connectionStateTb4b4b4,
Te6edf3onlineNodeCount Tff7b72= Te6edf3statusTb4b4b4.Te6edf3onlineNodeCountTb4b4b4,
Te6edf3totalNodeCount Tff7b72= Te6edf3statusTb4b4b4.Te6edf3totalNodeCountTb4b4b4,
Te6edf3localBatteryLevel Tff7b72= Te6edf3statusTb4b4b4.Te6edf3localBatteryLevelTb4b4b4,
Te6edf3localNodeName Tff7b72= Te6edf3statusTb4b4b4.Te6edf3localNodeNameTb4b4b4,
Tb4b4b4)
Tb4b4b4}
T8b949e/**
* List all nodes currently visible on the Meshtastic mesh network.
*
* Returns detailed information about each node including name, battery level, and last heard time. Nodes are sorted
* by most recently heard first.
*
* @param context The app function invocation context provided by the system.
* @return A list of nodes with their current status and metrics.
*/
Tf0883e@AppFunctionTb4b4b4(Te6edf3isDescribedByKDoc Tff7b72= Tff7b72trueTb4b4b4)
Tff7b72suspend Tff7b72fun Td2a8ffgetNodeListTb4b4b4(Te6edf3contextTb4b4b4: Te6edf3AppFunctionContextTb4b4b4)Tb4b4b4: Te6edf3GetNodeListResponse Tb4b4b4{
Tff7b72val Te6edf3result Tff7b72=
Tff7b72try Tb4b4b4{
Te6edf3providerTb4b4b4.Te6edf3getNodeListTb4b4b4(Tb4b4b4)
Tb4b4b4} Tff7b72catch Tb4b4b4(Te6edf3_Tb4b4b4: Te6edf3TimeoutCancellationExceptionTb4b4b4) Tb4b4b4{
Tff7b72throw Te6edf3AppFunctionInvalidArgumentExceptionTb4b4b4(
Ta5d6ff"Ta5d6ffRequest timed out. Ensure the mesh is connected and try again.Ta5d6ff"Tb4b4b4,
Tb4b4b4)
Tb4b4b4}
Tff7b72return Tff7b72when Tb4b4b4(Te6edf3resultTb4b4b4) Tb4b4b4{
Tff7b72is Te6edf3orgTb4b4b4.Te6edf3meshtasticTb4b4b4.Te6edf3coreTb4b4b4.Te6edf3dataTb4b4b4.Te6edf3aiTb4b4b4.Te6edf3GetNodeListResultTb4b4b4.Te6edf3Success Tff7b72-Tff7b72>
Te6edf3GetNodeListResponseTb4b4b4(
Te6edf3nodes Tff7b72=
Te6edf3resultTb4b4b4.Te6edf3nodesTb4b4b4.Te6edf3map Tb4b4b4{
Te6edf3NodeInfoTb4b4b4(
Te6edf3id Tff7b72= Tffa657itTb4b4b4.Te6edf3idTb4b4b4,
Te6edf3name Tff7b72= Tffa657itTb4b4b4.Te6edf3nameTb4b4b4,
Te6edf3batteryLevel Tff7b72= Tffa657itTb4b4b4.Te6edf3batteryLevelTb4b4b4,
Te6edf3lastHeard Tff7b72= Tffa657itTb4b4b4.Te6edf3lastHeardTb4b4b4,
Te6edf3isOnline Tff7b72= Tffa657itTb4b4b4.Te6edf3isOnlineTb4b4b4,
Tb4b4b4)
Tb4b4b4}Tb4b4b4,
Tb4b4b4)
Tff7b72is Te6edf3orgTb4b4b4.Te6edf3meshtasticTb4b4b4.Te6edf3coreTb4b4b4.Te6edf3dataTb4b4b4.Te6edf3aiTb4b4b4.Te6edf3GetNodeListResultTb4b4b4.Te6edf3NotConnected Tff7b72-Tff7b72>
Tff7b72throw Te6edf3AppFunctionNotSupportedExceptionTb4b4b4(Te6edf3resultTb4b4b4.Te6edf3messageTb4b4b4)
Tff7b72is Te6edf3orgTb4b4b4.Te6edf3meshtasticTb4b4b4.Te6edf3coreTb4b4b4.Te6edf3dataTb4b4b4.Te6edf3aiTb4b4b4.Te6edf3GetNodeListResultTb4b4b4.Te6edf3Error Tff7b72-Tff7b72>
Tff7b72throw Te6edf3AppFunctionInvalidArgumentExceptionTb4b4b4(Te6edf3resultTb4b4b4.Te6edf3reasonTb4b4b4)
Tb4b4b4}
Tb4b4b4}
T8b949e/**
* List all available Meshtastic mesh channels and their configurations.
*
* Returns details about each channel including name, index, primary status, and uplink/downlink settings.
*
* @param context The app function invocation context provided by the system.
* @return A list of channels with their current configuration.
*/
Tf0883e@AppFunctionTb4b4b4(Te6edf3isDescribedByKDoc Tff7b72= Tff7b72trueTb4b4b4)
Tff7b72suspend Tff7b72fun Td2a8ffgetChannelInfoTb4b4b4(Te6edf3contextTb4b4b4: Te6edf3AppFunctionContextTb4b4b4)Tb4b4b4: Te6edf3GetChannelInfoResponse Tb4b4b4{
Tff7b72val Te6edf3result Tff7b72=
Tff7b72try Tb4b4b4{
Te6edf3providerTb4b4b4.Te6edf3getChannelInfoTb4b4b4(Tb4b4b4)
Tb4b4b4} Tff7b72catch Tb4b4b4(Te6edf3_Tb4b4b4: Te6edf3TimeoutCancellationExceptionTb4b4b4) Tb4b4b4{
Tff7b72throw Te6edf3AppFunctionInvalidArgumentExceptionTb4b4b4(
Ta5d6ff"Ta5d6ffRequest timed out. Ensure the mesh is connected and try again.Ta5d6ff"Tb4b4b4,
Tb4b4b4)
Tb4b4b4}
Tff7b72return Tff7b72when Tb4b4b4(Te6edf3resultTb4b4b4) Tb4b4b4{
Tff7b72is Te6edf3orgTb4b4b4.Te6edf3meshtasticTb4b4b4.Te6edf3coreTb4b4b4.Te6edf3dataTb4b4b4.Te6edf3aiTb4b4b4.Te6edf3GetChannelInfoResultTb4b4b4.Te6edf3Success Tff7b72-Tff7b72>
Te6edf3GetChannelInfoResponseTb4b4b4(
Te6edf3channels Tff7b72=
Te6edf3resultTb4b4b4.Te6edf3channelsTb4b4b4.Te6edf3map Tb4b4b4{
Te6edf3ChannelInfoTb4b4b4(
Te6edf3index Tff7b72= Tffa657itTb4b4b4.Te6edf3indexTb4b4b4,
Te6edf3name Tff7b72= Tffa657itTb4b4b4.Te6edf3nameTb4b4b4,
Te6edf3isPrimary Tff7b72= Tffa657itTb4b4b4.Te6edf3isPrimaryTb4b4b4,
Te6edf3uplinkEnabled Tff7b72= Tffa657itTb4b4b4.Te6edf3uplinkEnabledTb4b4b4,
Te6edf3downlinkEnabled Tff7b72= Tffa657itTb4b4b4.Te6edf3downlinkEnabledTb4b4b4,
Tb4b4b4)
Tb4b4b4}Tb4b4b4,
Tb4b4b4)
Tff7b72is Te6edf3orgTb4b4b4.Te6edf3meshtasticTb4b4b4.Te6edf3coreTb4b4b4.Te6edf3dataTb4b4b4.Te6edf3aiTb4b4b4.Te6edf3GetChannelInfoResultTb4b4b4.Te6edf3NotConnected Tff7b72-Tff7b72>
Tff7b72throw Te6edf3AppFunctionNotSupportedExceptionTb4b4b4(Te6edf3resultTb4b4b4.Te6edf3messageTb4b4b4)
Tff7b72is Te6edf3orgTb4b4b4.Te6edf3meshtasticTb4b4b4.Te6edf3coreTb4b4b4.Te6edf3dataTb4b4b4.Te6edf3aiTb4b4b4.Te6edf3GetChannelInfoResultTb4b4b4.Te6edf3Error Tff7b72-Tff7b72>
Tff7b72throw Te6edf3AppFunctionInvalidArgumentExceptionTb4b4b4(Te6edf3resultTb4b4b4.Te6edf3reasonTb4b4b4)
Tb4b4b4}
Tb4b4b4}
T8b949e/**
* Get the status and metrics of the local Meshtastic radio device.
*
* Returns hardware model, firmware version, battery level, charging status, and current radio state.
*
* @param context The app function invocation context provided by the system.
* @return Device status with current metrics and configuration.
*/
Tf0883e@AppFunctionTb4b4b4(Te6edf3isDescribedByKDoc Tff7b72= Tff7b72trueTb4b4b4)
Tff7b72suspend Tff7b72fun Td2a8ffgetDeviceStatusTb4b4b4(Te6edf3contextTb4b4b4: Te6edf3AppFunctionContextTb4b4b4)Tb4b4b4: Te6edf3GetDeviceStatusResponse Tb4b4b4{
Tff7b72val Te6edf3result Tff7b72=
Tff7b72try Tb4b4b4{
Te6edf3providerTb4b4b4.Te6edf3getDeviceStatusTb4b4b4(Tb4b4b4)
Tb4b4b4} Tff7b72catch Tb4b4b4(Te6edf3_Tb4b4b4: Te6edf3TimeoutCancellationExceptionTb4b4b4) Tb4b4b4{
Tff7b72throw Te6edf3AppFunctionInvalidArgumentExceptionTb4b4b4(
Ta5d6ff"Ta5d6ffRequest timed out. Ensure the device is initialized and try again.Ta5d6ff"Tb4b4b4,
Tb4b4b4)
Tb4b4b4}
Tff7b72return Tff7b72when Tb4b4b4(Te6edf3resultTb4b4b4) Tb4b4b4{
Tff7b72is Te6edf3orgTb4b4b4.Te6edf3meshtasticTb4b4b4.Te6edf3coreTb4b4b4.Te6edf3dataTb4b4b4.Te6edf3aiTb4b4b4.Te6edf3GetDeviceStatusResultTb4b4b4.Te6edf3Success Tff7b72-Tff7b72>
Te6edf3GetDeviceStatusResponseTb4b4b4(
Te6edf3model Tff7b72= Te6edf3resultTb4b4b4.Te6edf3deviceTb4b4b4.Te6edf3modelTb4b4b4,
Te6edf3firmwareVersion Tff7b72= Te6edf3resultTb4b4b4.Te6edf3deviceTb4b4b4.Te6edf3firmwareVersionTb4b4b4,
Te6edf3batteryLevel Tff7b72= Te6edf3resultTb4b4b4.Te6edf3deviceTb4b4b4.Te6edf3batteryLevelTb4b4b4,
Te6edf3chargingStatus Tff7b72= Te6edf3resultTb4b4b4.Te6edf3deviceTb4b4b4.Te6edf3chargingStatusTb4b4b4,
Te6edf3deviceName Tff7b72= Te6edf3resultTb4b4b4.Te6edf3deviceTb4b4b4.Te6edf3deviceNameTb4b4b4,
Te6edf3isActive Tff7b72= Te6edf3resultTb4b4b4.Te6edf3deviceTb4b4b4.Te6edf3isActiveTb4b4b4,
Tb4b4b4)
Tff7b72is Te6edf3orgTb4b4b4.Te6edf3meshtasticTb4b4b4.Te6edf3coreTb4b4b4.Te6edf3dataTb4b4b4.Te6edf3aiTb4b4b4.Te6edf3GetDeviceStatusResultTb4b4b4.Te6edf3NotAvailable Tff7b72-Tff7b72>
Tff7b72throw Te6edf3AppFunctionNotSupportedExceptionTb4b4b4(Te6edf3resultTb4b4b4.Te6edf3messageTb4b4b4)
Tff7b72is Te6edf3orgTb4b4b4.Te6edf3meshtasticTb4b4b4.Te6edf3coreTb4b4b4.Te6edf3dataTb4b4b4.Te6edf3aiTb4b4b4.Te6edf3GetDeviceStatusResultTb4b4b4.Te6edf3Error Tff7b72-Tff7b72>
Tff7b72throw Te6edf3AppFunctionInvalidArgumentExceptionTb4b4b4(Te6edf3resultTb4b4b4.Te6edf3reasonTb4b4b4)
Tb4b4b4}
Tb4b4b4}
T8b949e/**
* Retrieve detailed telemetry and status for a specific mesh node.
*
* Returns per-node metrics including battery level, signal strength, hardware model, and location data.
*
* @param context The app function invocation context provided by the system.
* @param nodeId The target node ID (e.g., '!abc12345' or user ID).
* @return A [GetNodeDetailsResponse] with detailed node information.
*/
Tf0883e@AppFunctionTb4b4b4(Te6edf3isDescribedByKDoc Tff7b72= Tff7b72trueTb4b4b4)
Tff7b72suspend Tff7b72fun Td2a8ffgetNodeDetailsTb4b4b4(Te6edf3contextTb4b4b4: Te6edf3AppFunctionContextTb4b4b4, Te6edf3nodeIdTb4b4b4: Tffa657StringTb4b4b4)Tb4b4b4: Te6edf3GetNodeDetailsResponse Tb4b4b4{
Tff7b72val Te6edf3result Tff7b72=
Tff7b72try Tb4b4b4{
Te6edf3providerTb4b4b4.Te6edf3getNodeDetailsTb4b4b4(Te6edf3nodeIdTb4b4b4)
Tb4b4b4} Tff7b72catch Tb4b4b4(Te6edf3_Tb4b4b4: Te6edf3TimeoutCancellationExceptionTb4b4b4) Tb4b4b4{
Tff7b72throw Te6edf3AppFunctionInvalidArgumentExceptionTb4b4b4(
Ta5d6ff"Ta5d6ffRequest timed out. Ensure the mesh is connected and try again.Ta5d6ff"Tb4b4b4,
Tb4b4b4)
Tb4b4b4}
Tff7b72return Tff7b72when Tb4b4b4(Te6edf3resultTb4b4b4) Tb4b4b4{
Tff7b72is Te6edf3orgTb4b4b4.Te6edf3meshtasticTb4b4b4.Te6edf3coreTb4b4b4.Te6edf3dataTb4b4b4.Te6edf3aiTb4b4b4.Te6edf3GetNodeDetailsResultTb4b4b4.Te6edf3Success Tff7b72-Tff7b72>
Te6edf3GetNodeDetailsResponseTb4b4b4(
Te6edf3id Tff7b72= Te6edf3resultTb4b4b4.Te6edf3nodeTb4b4b4.Te6edf3idTb4b4b4,
Te6edf3userId Tff7b72= Te6edf3resultTb4b4b4.Te6edf3nodeTb4b4b4.Te6edf3userIdTb4b4b4,
Te6edf3name Tff7b72= Te6edf3resultTb4b4b4.Te6edf3nodeTb4b4b4.Te6edf3nameTb4b4b4,
Te6edf3batteryLevel Tff7b72= Te6edf3resultTb4b4b4.Te6edf3nodeTb4b4b4.Te6edf3batteryLevelTb4b4b4,
Te6edf3voltage Tff7b72= Te6edf3resultTb4b4b4.Te6edf3nodeTb4b4b4.Te6edf3voltageTb4b4b4,
Te6edf3hardwareModel Tff7b72= Te6edf3resultTb4b4b4.Te6edf3nodeTb4b4b4.Te6edf3hardwareModelTb4b4b4,
Te6edf3firmwareVersion Tff7b72= Te6edf3resultTb4b4b4.Te6edf3nodeTb4b4b4.Te6edf3firmwareVersionTb4b4b4,
Te6edf3snr Tff7b72= Te6edf3resultTb4b4b4.Te6edf3nodeTb4b4b4.Te6edf3snrTb4b4b4,
Te6edf3rssi Tff7b72= Te6edf3resultTb4b4b4.Te6edf3nodeTb4b4b4.Te6edf3rssiTb4b4b4,
Te6edf3hopsAway Tff7b72= Te6edf3resultTb4b4b4.Te6edf3nodeTb4b4b4.Te6edf3hopsAwayTb4b4b4,
Te6edf3channel Tff7b72= Te6edf3resultTb4b4b4.Te6edf3nodeTb4b4b4.Te6edf3channelTb4b4b4,
Te6edf3lastHeard Tff7b72= Te6edf3resultTb4b4b4.Te6edf3nodeTb4b4b4.Te6edf3lastHeardTb4b4b4,
Te6edf3userRole Tff7b72= Te6edf3resultTb4b4b4.Te6edf3nodeTb4b4b4.Te6edf3userRoleTb4b4b4,
Te6edf3isLicensed Tff7b72= Te6edf3resultTb4b4b4.Te6edf3nodeTb4b4b4.Te6edf3isLicensedTb4b4b4,
Te6edf3latitude Tff7b72= Te6edf3resultTb4b4b4.Te6edf3nodeTb4b4b4.Te6edf3latitudeTb4b4b4,
Te6edf3longitude Tff7b72= Te6edf3resultTb4b4b4.Te6edf3nodeTb4b4b4.Te6edf3longitudeTb4b4b4,
Tb4b4b4)
Tff7b72is Te6edf3orgTb4b4b4.Te6edf3meshtasticTb4b4b4.Te6edf3coreTb4b4b4.Te6edf3dataTb4b4b4.Te6edf3aiTb4b4b4.Te6edf3GetNodeDetailsResultTb4b4b4.Te6edf3NotConnected Tff7b72-Tff7b72>
Tff7b72throw Te6edf3AppFunctionNotSupportedExceptionTb4b4b4(Te6edf3resultTb4b4b4.Te6edf3messageTb4b4b4)
Tff7b72is Te6edf3orgTb4b4b4.Te6edf3meshtasticTb4b4b4.Te6edf3coreTb4b4b4.Te6edf3dataTb4b4b4.Te6edf3aiTb4b4b4.Te6edf3GetNodeDetailsResultTb4b4b4.Te6edf3NotFound Tff7b72-Tff7b72>
Tff7b72throw Te6edf3AppFunctionElementNotFoundExceptionTb4b4b4(Te6edf3resultTb4b4b4.Te6edf3messageTb4b4b4)
Tff7b72is Te6edf3orgTb4b4b4.Te6edf3meshtasticTb4b4b4.Te6edf3coreTb4b4b4.Te6edf3dataTb4b4b4.Te6edf3aiTb4b4b4.Te6edf3GetNodeDetailsResultTb4b4b4.Te6edf3Error Tff7b72-Tff7b72>
Tff7b72throw Te6edf3AppFunctionInvalidArgumentExceptionTb4b4b4(Te6edf3resultTb4b4b4.Te6edf3reasonTb4b4b4)
Tb4b4b4}
Tb4b4b4}
T8b949e/**
* Retrieve aggregate network metrics and statistics for the entire mesh.
*
* Returns mesh-wide analytics including total node count, online nodes, average battery level, and health score.
*
* @param context The app function invocation context provided by the system.
* @return A [GetMeshMetricsResponse] with mesh-wide statistics.
*/
Tf0883e@AppFunctionTb4b4b4(Te6edf3isDescribedByKDoc Tff7b72= Tff7b72trueTb4b4b4)
Tff7b72suspend Tff7b72fun Td2a8ffgetMeshMetricsTb4b4b4(Te6edf3contextTb4b4b4: Te6edf3AppFunctionContextTb4b4b4)Tb4b4b4: Te6edf3GetMeshMetricsResponse Tb4b4b4{
Tff7b72val Te6edf3result Tff7b72=
Tff7b72try Tb4b4b4{
Te6edf3providerTb4b4b4.Te6edf3getMeshMetricsTb4b4b4(Tb4b4b4)
Tb4b4b4} Tff7b72catch Tb4b4b4(Te6edf3_Tb4b4b4: Te6edf3TimeoutCancellationExceptionTb4b4b4) Tb4b4b4{
Tff7b72throw Te6edf3AppFunctionInvalidArgumentExceptionTb4b4b4(
Ta5d6ff"Ta5d6ffRequest timed out. Ensure the mesh is connected and try again.Ta5d6ff"Tb4b4b4,
Tb4b4b4)
Tb4b4b4}
Tff7b72return Tff7b72when Tb4b4b4(Te6edf3resultTb4b4b4) Tb4b4b4{
Tff7b72is Te6edf3orgTb4b4b4.Te6edf3meshtasticTb4b4b4.Te6edf3coreTb4b4b4.Te6edf3dataTb4b4b4.Te6edf3aiTb4b4b4.Te6edf3GetMeshMetricsResultTb4b4b4.Te6edf3Success Tff7b72-Tff7b72>
Te6edf3GetMeshMetricsResponseTb4b4b4(
Te6edf3totalNodeCount Tff7b72= Te6edf3resultTb4b4b4.Te6edf3metricsTb4b4b4.Te6edf3totalNodeCountTb4b4b4,
Te6edf3onlineNodeCount Tff7b72= Te6edf3resultTb4b4b4.Te6edf3metricsTb4b4b4.Te6edf3onlineNodeCountTb4b4b4,
Te6edf3averageBatteryLevel Tff7b72= Te6edf3resultTb4b4b4.Te6edf3metricsTb4b4b4.Te6edf3averageBatteryLevelTb4b4b4,
Te6edf3meshHealthScore Tff7b72= Te6edf3resultTb4b4b4.Te6edf3metricsTb4b4b4.Te6edf3meshHealthScoreTb4b4b4,
Te6edf3mostRecentPacketTime Tff7b72= Te6edf3resultTb4b4b4.Te6edf3metricsTb4b4b4.Te6edf3mostRecentPacketTimeTb4b4b4,
Te6edf3meshUptimeSeconds Tff7b72= Te6edf3resultTb4b4b4.Te6edf3metricsTb4b4b4.Te6edf3meshUptimeSecondsTb4b4b4,
Te6edf3channelUtilizationPercent Tff7b72= Te6edf3resultTb4b4b4.Te6edf3metricsTb4b4b4.Te6edf3channelUtilizationPercentTb4b4b4,
Tb4b4b4)
Tff7b72is Te6edf3orgTb4b4b4.Te6edf3meshtasticTb4b4b4.Te6edf3coreTb4b4b4.Te6edf3dataTb4b4b4.Te6edf3aiTb4b4b4.Te6edf3GetMeshMetricsResultTb4b4b4.Te6edf3NotConnected Tff7b72-Tff7b72>
Tff7b72throw Te6edf3AppFunctionNotSupportedExceptionTb4b4b4(Te6edf3resultTb4b4b4.Te6edf3messageTb4b4b4)
Tff7b72is Te6edf3orgTb4b4b4.Te6edf3meshtasticTb4b4b4.Te6edf3coreTb4b4b4.Te6edf3dataTb4b4b4.Te6edf3aiTb4b4b4.Te6edf3GetMeshMetricsResultTb4b4b4.Te6edf3Error Tff7b72-Tff7b72>
Tff7b72throw Te6edf3AppFunctionInvalidArgumentExceptionTb4b4b4(Te6edf3resultTb4b4b4.Te6edf3reasonTb4b4b4)
Tb4b4b4}
Tb4b4b4}
T8b949e/**
* Retrieve recent messages received over the Meshtastic mesh radio network.
*
* Returns a list of recent messages from the local message history. Messages are stored locally and do not require
* an active mesh connection. Useful for catching up on conversations or reviewing recent communications.
*
* @param context The app function invocation context provided by the system.
* @param contactName Optional name of a node or channel to filter messages from. If omitted, returns messages from
* all contacts sorted by most recent.
* @param limit Maximum number of messages to return (1–50). Defaults to 20.
* @return A [GetRecentMessagesResponse] containing the list of recent messages.
*/
Tf0883e@AppFunctionTb4b4b4(Te6edf3isDescribedByKDoc Tff7b72= Tff7b72trueTb4b4b4)
Tff7b72suspend Tff7b72fun Td2a8ffgetRecentMessagesTb4b4b4(
Te6edf3contextTb4b4b4: Te6edf3AppFunctionContextTb4b4b4,
Te6edf3contactNameTb4b4b4: Tffa657String? Tff7b72= Tff7b72nullTb4b4b4,
Tf0883e@AppFunctionIntValueConstraintTb4b4b4(Te6edf3enumValues Tff7b72= Tff7b72[T79c0ff1Tb4b4b4, T79c0ff5Tb4b4b4, T79c0ff1T79c0ff0Tb4b4b4, T79c0ff2T79c0ff0Tb4b4b4, T79c0ff5T79c0ff0Tff7b72]Tb4b4b4)
Te6edf3limitTb4b4b4: Tffa657Int Tff7b72= Te6edf3AiFunctionProviderTb4b4b4.Te6edf3DEFAULT_MESSAGE_LIMITTb4b4b4,
Tb4b4b4)Tb4b4b4: Te6edf3GetRecentMessagesResponse Tb4b4b4{
Tff7b72val Te6edf3result Tff7b72=
Tff7b72try Tb4b4b4{
Te6edf3providerTb4b4b4.Te6edf3getRecentMessagesTb4b4b4(Te6edf3contactNameTb4b4b4, Te6edf3limitTb4b4b4)
Tb4b4b4} Tff7b72catch Tb4b4b4(Te6edf3_Tb4b4b4: Te6edf3TimeoutCancellationExceptionTb4b4b4) Tb4b4b4{
Tff7b72throw Te6edf3AppFunctionInvalidArgumentExceptionTb4b4b4(Ta5d6ff"Ta5d6ffRequest timed out. Try again or reduce the message limit.Ta5d6ff"Tb4b4b4)
Tb4b4b4}
Tff7b72return Tff7b72when Tb4b4b4(Te6edf3resultTb4b4b4) Tb4b4b4{
Tff7b72is Te6edf3orgTb4b4b4.Te6edf3meshtasticTb4b4b4.Te6edf3coreTb4b4b4.Te6edf3dataTb4b4b4.Te6edf3aiTb4b4b4.Te6edf3GetRecentMessagesResultTb4b4b4.Te6edf3Success Tff7b72-Tff7b72>
Te6edf3GetRecentMessagesResponseTb4b4b4(
Te6edf3messages Tff7b72=
Te6edf3resultTb4b4b4.Te6edf3messagesTb4b4b4.Te6edf3map Tb4b4b4{ Te6edf3msg Tff7b72-Tff7b72>
Te6edf3MessageInfoTb4b4b4(
Te6edf3senderName Tff7b72= Te6edf3msgTb4b4b4.Te6edf3senderNameTb4b4b4,
Te6edf3text Tff7b72= Te6edf3msgTb4b4b4.Te6edf3textTb4b4b4,
Te6edf3contactName Tff7b72= Te6edf3msgTb4b4b4.Te6edf3contactNameTb4b4b4,
Te6edf3receivedTime Tff7b72= Te6edf3msgTb4b4b4.Te6edf3receivedTimeTb4b4b4,
Te6edf3fromLocal Tff7b72= Te6edf3msgTb4b4b4.Te6edf3fromLocalTb4b4b4,
Te6edf3read Tff7b72= Te6edf3msgTb4b4b4.Te6edf3readTb4b4b4,
Tb4b4b4)
Tb4b4b4}Tb4b4b4,
Tb4b4b4)
Tff7b72is Te6edf3orgTb4b4b4.Te6edf3meshtasticTb4b4b4.Te6edf3coreTb4b4b4.Te6edf3dataTb4b4b4.Te6edf3aiTb4b4b4.Te6edf3GetRecentMessagesResultTb4b4b4.Te6edf3ContactNotFound Tff7b72-Tff7b72>
Tff7b72throw Te6edf3AppFunctionElementNotFoundExceptionTb4b4b4(Te6edf3resultTb4b4b4.Te6edf3messageTb4b4b4)
Tff7b72is Te6edf3orgTb4b4b4.Te6edf3meshtasticTb4b4b4.Te6edf3coreTb4b4b4.Te6edf3dataTb4b4b4.Te6edf3aiTb4b4b4.Te6edf3GetRecentMessagesResultTb4b4b4.Te6edf3Error Tff7b72-Tff7b72>
Tff7b72throw Te6edf3AppFunctionInvalidArgumentExceptionTb4b4b4(Te6edf3resultTb4b4b4.Te6edf3reasonTb4b4b4)
Tb4b4b4}
Tb4b4b4}
T8b949e/**
* Get a summary of unread messages across all Meshtastic mesh contacts.
*
* Returns the total unread count and a per-contact breakdown showing who sent unread messages, how many are unread,
* and a preview of the last message. Muted contacts are excluded. Does not require an active mesh connection.
*
* @param context The app function invocation context provided by the system.
* @return A [GetUnreadSummaryResponse] with the total unread count and per-contact details.
*/
Tf0883e@AppFunctionTb4b4b4(Te6edf3isDescribedByKDoc Tff7b72= Tff7b72trueTb4b4b4)
Tff7b72suspend Tff7b72fun Td2a8ffgetUnreadSummaryTb4b4b4(Te6edf3contextTb4b4b4: Te6edf3AppFunctionContextTb4b4b4)Tb4b4b4: Te6edf3GetUnreadSummaryResponse Tb4b4b4{
Tff7b72val Te6edf3result Tff7b72=
Tff7b72try Tb4b4b4{
Te6edf3providerTb4b4b4.Te6edf3getUnreadSummaryTb4b4b4(Tb4b4b4)
Tb4b4b4} Tff7b72catch Tb4b4b4(Te6edf3_Tb4b4b4: Te6edf3TimeoutCancellationExceptionTb4b4b4) Tb4b4b4{
Tff7b72throw Te6edf3AppFunctionInvalidArgumentExceptionTb4b4b4(Ta5d6ff"Ta5d6ffRequest timed out. Try again.Ta5d6ff"Tb4b4b4)
Tb4b4b4}
Tff7b72return Tff7b72when Tb4b4b4(Te6edf3resultTb4b4b4) Tb4b4b4{
Tff7b72is Te6edf3orgTb4b4b4.Te6edf3meshtasticTb4b4b4.Te6edf3coreTb4b4b4.Te6edf3dataTb4b4b4.Te6edf3aiTb4b4b4.Te6edf3GetUnreadSummaryResultTb4b4b4.Te6edf3Success Tff7b72-Tff7b72>
Te6edf3GetUnreadSummaryResponseTb4b4b4(
Te6edf3totalUnreadCount Tff7b72= Te6edf3resultTb4b4b4.Te6edf3summaryTb4b4b4.Te6edf3totalUnreadCountTb4b4b4,
Te6edf3contacts Tff7b72=
Te6edf3resultTb4b4b4.Te6edf3summaryTb4b4b4.Te6edf3contactsTb4b4b4.Te6edf3map Tb4b4b4{ Te6edf3contact Tff7b72-Tff7b72>
Te6edf3ContactUnreadInfoTb4b4b4(
Te6edf3name Tff7b72= Te6edf3contactTb4b4b4.Te6edf3nameTb4b4b4,
Te6edf3unreadCount Tff7b72= Te6edf3contactTb4b4b4.Te6edf3unreadCountTb4b4b4,
Te6edf3lastMessagePreview Tff7b72= Te6edf3contactTb4b4b4.Te6edf3lastMessagePreviewTb4b4b4,
Te6edf3lastMessageTime Tff7b72= Te6edf3contactTb4b4b4.Te6edf3lastMessageTimeTb4b4b4,
Tb4b4b4)
Tb4b4b4}Tb4b4b4,
Tb4b4b4)
Tff7b72is Te6edf3orgTb4b4b4.Te6edf3meshtasticTb4b4b4.Te6edf3coreTb4b4b4.Te6edf3dataTb4b4b4.Te6edf3aiTb4b4b4.Te6edf3GetUnreadSummaryResultTb4b4b4.Te6edf3Error Tff7b72-Tff7b72>
Tff7b72throw Te6edf3AppFunctionInvalidArgumentExceptionTb4b4b4(Te6edf3resultTb4b4b4.Te6edf3reasonTb4b4b4)
Tb4b4b4}
Tb4b4b4}
Tb4b4b4}
Served by rngit 1.5.0 - Generated in 0.08s